package cn.edu.scnu.impl;

import cn.edu.scnu.entity.MovieStats;
import cn.edu.scnu.mapper.MovieStatsMapper;
import cn.edu.scnu.service.MovieStatsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MovieStatsServiceImpl implements MovieStatsService {

    @Autowired
    private MovieStatsMapper movieStatsMapper;

    @Override
    public List<MovieStats> getWeeklyViewsData() {
        return movieStatsMapper.selectWeeklyViewsData();
    }

    @Override
    public List<MovieStats> getMonthlyViewsData() {
        return movieStatsMapper.selectMonthlyViewsData();
    }

    @Override
    public List<MovieStats> getAllMovieStats() {
        return movieStatsMapper.selectList(null);
    }
}

